<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>浮动V2clear清除浮动</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        /*如果子元素都是float的， 那么父亲如果没有给高度， 就会塌陷下去， 这就是高度塌陷*/
        main{
            border: 2px solid black;
        }
        article{
            width: 10rem;
            height: 10rem;
        }
        .box1{
            background-color: cyan;
            float: left;
        }
        .box2{
            background-color:purple;
            float: left;
        }
        .box3{
            background-color: gray;
            /*clear: left;*/
            float: left;
        }
    </style>
</head>
<body>
<main>
    <article class="box1"></article>
    <article class="box2"></article>
    <article class="box3"></article>
</main>

</body>
</html>
